package events;

import java.util.EventObject;

import p2pmodule.Item;

/**
 * Listener that will handle the event raised when a file has been found in a
 * P2P network.
 * 
 * @author ole
 */
public class FileFoundEvent extends EventObject {
	// Class constants.
	private static final long serialVersionUID = 1L;
	
	// Class attributes.
	private Item item_found = null;
	
	/**
	 * Class constructor.
	 * 
	 * @param source:
	 * 		The object that raised the event.
	 * @param item:
	 * 		The Item found in the P2P network.
	 */
	public FileFoundEvent(Object source, Item item) {
		super(source);
		item_found = item;
	}
	
	/**
	 * Returns the Item found in the P2P network that triggers this event.
	 * 
	 * @return:
	 * 		A P2pItem with the item found.
	 */
	public Item getItemFound() {
		return item_found;
	}
}
